#ifndef __GRAY_TRACK_H
#define __GRAY_TRACK_H

#include "stm32f4xx.h"

/* 循迹模块引脚宏定义 */
#define T1_GPIO     GPIOD
#define T1_PIN      GPIO_Pin_8
#define T2_GPIO     GPIOD
#define T2_PIN      GPIO_Pin_9
#define T3_GPIO     GPIOD
#define T3_PIN      GPIO_Pin_10
#define T4_GPIO     GPIOD
#define T4_PIN      GPIO_Pin_11
#define T5_GPIO     GPIOD
#define T5_PIN      GPIO_Pin_0
#define T6_GPIO     GPIOD
#define T6_PIN      GPIO_Pin_1
#define T7_GPIO     GPIOD
#define T7_PIN      GPIO_Pin_14
#define T8_GPIO     GPIOD
#define T8_PIN      GPIO_Pin_15

/* 循迹模块读取宏定义 */
#define P1  GPIO_ReadInputDataBit(T1_GPIO, T1_PIN)
#define P2  GPIO_ReadInputDataBit(T2_GPIO, T2_PIN)
#define P3  GPIO_ReadInputDataBit(T3_GPIO, T3_PIN)
#define P4  GPIO_ReadInputDataBit(T4_GPIO, T4_PIN)
#define P5  GPIO_ReadInputDataBit(T5_GPIO, T5_PIN)
#define P6  GPIO_ReadInputDataBit(T6_GPIO, T6_PIN)
#define P7  GPIO_ReadInputDataBit(T7_GPIO, T7_PIN)
#define P8  GPIO_ReadInputDataBit(T8_GPIO, T8_PIN)

/* 黑线白线标志 */
typedef enum {
    WhiteLine = 1,
    BlackLine = 0,
} LineColor_t;

void Track_Init(void);

#endif
